function makeAudioFile(AudioIn, Mic, NAME)

Fs = str2double(Mic.info.nominal_srate);
dataInc = 1/Fs;

%Find the shared time range between the two channels
%Find the first shared time point
if(Mic.time_stamps(1,1)<AudioIn.time_stamps(1,1))
    firstCombinedTimePoint = AudioIn.time_stamps(1,1);
else
    firstCombinedTimePoint = Mic.time_stamps(1,1);
end
%Find the second shared time point--ie the last time point
if(Mic.time_stamps(1,end)>AudioIn.time_stamps(1,end))
    lastCombinedTimePoint = AudioIn.time_stamps(1,end);
else
    lastCombinedTimePoint = Mic.time_stamps(1,end);
end

%exclude the data points that are shared between the two audio channels
TimeRangeMask = (Mic.time_stamps<firstCombinedTimePoint) |(Mic.time_stamps>lastCombinedTimePoint);
M = Mic.time_series(1,:);

M(TimeRangeMask) = [];
M_TStamps = Mic.time_stamps(~TimeRangeMask);

%resample the AudioIn data to match the Mic's time points
AI = interp1(AudioIn.time_stamps,  AudioIn.time_series(1,:), M_TStamps);

%Amplify the volume to the max
AI = AI.*(1/max(abs(AI)));
M = M.*(1/max(abs(M)));

audiowrite(strcat('./ToUpload/',NAME,'.m4a'),[M' AI'],Fs);


%should I write out the new audio data to save?  easy enough to replicate
%it. So Im taking the path of least data storage.


